IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'EvaluationGetByCompanyID')
	BEGIN
		DROP  Procedure  EvaluationGetByCompanyID
	END

GO

CREATE Procedure EvaluationGetByCompanyID
(
	@CompanyID int
)
AS

SELECT e.EvaluationID
	, e.EvaluationSourceID
	, e.RecommendationID
	, e.RatingTypeID
	, e.Description
	, e.URL
	, e.EvaluationDate
FROM Evaluations as e
INNER JOIN Recommendations as r
	ON e.RecommendationID = r.RecommendationID
WHERE r.CompanyID = @CompanyID

